<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2024-06-04
Time: 16:10
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link type="text/css" rel="stylesheet" href="../css/style.css" />
</head>
<body>
<jsp:include page="top.jsp" />
<div id="vote" class="wrap">
	<h2>查看投票</h2>
	<ul class="list">
		<li>
			<h4>${voteSubject.vsTitle}</h4>
			<p class="info">共有 ${fn:length(voteSubject.voteOptions)} 个选项，已有 ${fn:length(voteSubject.voteItems)} 个网友参与了投票。</p>
				<ol>
					<c:forEach items="${voteSubject.voteOptions}" var="voteOption">
					<li>${voteOption.voOption}
						<div class="rate">
							<div class="ratebg">
								<div class="percent" style="width:${fn:length(voteOption.voteItems) gt 0 ? fn:length(voteOption.voteItems)/fn:length(voteSubject.voteItems)*100 : 0}%"></div>
							</div>
							<p>${fn:length(voteOption.voteItems)}票
								<span>
								<fmt:formatNumber type="number" pattern="#.00" value="${fn:length(voteOption.voteItems) gt 0 ? fn:length(voteOption.voteItems)/fn:length(voteSubject.voteItems)*100 : 0}"  />
								</span>
							</p>
						</div>
					</li>
					</c:forEach>
				</ol>
				<div class="goback"><a href="/vote?vsid=${voteSubject.vsId}">返回投票列表</a></div>
<%--				<div class="goback"><a href="javascript:history.go(-1);">返回投票列表</a></div>--%>
		</li>
	</ul>
</div>
<div id="footer" class="wrap">
	北大青鸟 &copy; 版权所有
</div>
</body>
</html>
